<template>
  <div class="box">
    <h1>Child{{index}}</h1>
    <button @click="addCount">累加父组件的值</button>
    <button @click="$emit('click')">child3专属点击</button>
  </div>
</template>

<script>
export default {
    name:'Child',
    props:['index'],
    methods: {
      addCount(){
        this.$emit('changeCount',1)
      }
    },
}
</script>

<style scoped>
    .box{
        background: yellowgreen;
    }
</style>